home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / ums / ums-beta / rexxdossupport / rxds_test.rexx < prev   
OS/2 REXX Batch file  |  1994-09-10  |  2KB  |  82 lines

  1. /* RxDS_test.rexx --- test for RexxDosSupport.library */
  2.  
  3. call addlib("rexxdossupport.library",0,-30,2)
  4. say "foobar"
  5.  
  6. if ~ MakeDir("ram:foo") then say fault(rc, "test");
  7. if ~ Rename("ram:foo","ram:bar") then say fault(rc, "test");
  8. if ~ SetComment("ram:bar","stupit comment") then say fault(rc, "test");
  9. if ~ SetProtection("ram:bar",'00000000'x) then say fault(rc, "test");
  10. if ~ Delete("ram:bar") then say fault(rc, "test");
  11.  
  12. text = fault(0,"test")
  13. if rc = 0 then say text
  14. text = fault(215,"test")
  15. if rc = 0 then say text
  16. text = fault(215)
  17. if rc = 0 then say text
  18.  
  19. server = 'default'
  20.  
  21. template = "name/A,,passwd,server/K,prio/N"
  22. input = "hartmut foobar prio 10"
  23.  
  24. if ReadArgs(input,template) then
  25.   say args.name '--' args.passwd '--' args.server '--' args.prio
  26.   say name '--' passwd '--' server '--' prio
  27. if ReadArgs(input,template,"args.") then
  28.   say args.name '--' args.passwd '--' args.server '--' args.prio
  29.  
  30. if ~ ReadArgs("server=default", template, "args.") then
  31.   say Fault(rc,"test")
  32.  
  33. template = "name/M,test/S"
  34. trace ?r
  35. input = "ich du er sie es test"
  36.  
  37. if ReadArgs(input,template) then do
  38.   say name.count test
  39.   do i = 0 for name.count by 1
  40.     say name.i
  41.   end
  42. end
  43.  
  44. pattern = "ha*mut"
  45. string = "hartmut"
  46.  
  47. say MatchPattern(pattern,string);
  48.  
  49. string = Upper(string)
  50. say MatchPattern(pattern,string);
  51. say MatchPattern(pattern,string,"N");
  52.  
  53. string = "hartmut"
  54. pattern = parsePattern(string)
  55. say rc
  56. pattern = ParsePattern("ha*mut")
  57. say MatchPattern(pattern,string,,"P");
  58. string = Upper(string)
  59. say MatchPattern(pattern,string,,"P");
  60. pattern = ParsePattern("har*ut","N")
  61. say MatchPattern(pattern,string,"N","P");
  62.  
  63.  
  64. result = GetVar("foobar")
  65. IF rc = 0 THEN
  66.   say "foobar has value" result;
  67. else
  68.   say "foobar not set"
  69.  
  70. SetVar("foobar", "test", "L")
  71. result = GetVar("foobar")
  72. IF rc = 0 THEN say "foobar has value" result;
  73.           else say "foobar not set"
  74. reslt = GetVar("foobar","L")
  75. IF rc = 0 THEN say "L: foobar has value" result;
  76.           else say "L: foobar not set"
  77. result = GetVar("foobar","G")
  78. IF rc = 0 THEN say "G: foobar has value" result;
  79.           else say "G: foobar not set"
  80. say DeleteVar("foobar", "L")
  81.  
  82.